# -*- codeing = utf-8 -*-
# @Time : 2020/7/31 10:33
# @Author : haos
# @File : sss.py
# @Software : PyCharm

import spider as sp
def main():
    client = sp.get_client()
    for link in client.find({'valid': 1, 'year': '2016', 'exist': 0}).batch_size(5):
        # 抓取未抓取链接的数据
        print(link['url'])
        sp.export_excel(link)
        # 修改已抓取数据的状态
        sp.update_link_state(client, link)
main()